<template>
  <div>
    <div class="text">{{ data }}</div>
  </div>
</template>

<script>
import redis from '@/api/redis'

export default {
  name: 'String',
  props: {
    keyObj: {
      type: Object,
      required: true
    },
    connParam: {
      type: Object,
      required: true
    },
    serializerParam: {
      type: Object,
      required: true
    }
  },
  data() {
    return {
      data: null
    }
  },
  methods: {
    getData() {
      return this.data
    },
    loadData() {
      redis.readData(this.connParam, this.keyObj.key, this.serializerParam).then(res => {
        this.data = res.data
      })
    }
  }
}
</script>


